<?php
/**************************************************************************
	ESAM (EVE to SMF API Module)
	Copyright (C) 2009  Clinton Weiss

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/

include_once "EsamQuery.php";

class EsamRules
{
	function addRule($type, $role, $role_id, $group_id, $skillTypeId, $skillLvl)
	{
		$esamQuery = new EsamQuery();
		$esamQuery->setQuery($esamQuery->I_RULE_INSERT);
		$esamQuery->setParameter("type", $type);
		$esamQuery->setParameter("role", $role);
		$esamQuery->setParameter("role_id", $role_id);
		$esamQuery->setParameter("group_id", $group_id);
    $esamQuery->setParameter("skill_type_id", $skillTypeId);
    $esamQuery->setParameter("skill_lvl", $skillLvl);
		$esamQuery->executeQuery();
	}

	function deleteRule($id_rule)
	{
		$esamQuery = new EsamQuery();
		$esamQuery->setQuery($esamQuery->D_RULE_DELETE);
		$esamQuery->setParameter("id_rule", $id_rule);
		$esamQuery->executeQuery();
	}

	function listRules()
	{
		$esamQuery = new EsamQuery();
		$esamQuery->setQuery($esamQuery->Q_RULES);
		return $esamQuery->getResultSet();
	}
}

?>
